package com.dalin.platform.pub;

import java.io.File;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dalin.common.utils.FileUtils;
import com.dalin.common.utils.search.LuceneUtils;
import com.dalin.framework.action.ServletAction;
import com.dalin.platform.loa.LoaConst;

/*****************************************************************************
 * @content: 平台初始化参数类 *
 * @author : 那建林 *
 * @crtDate: 2010-04-26 *
 * @version: 1.1 *
 ****************************************************************************/
public class PlatInitParamsAction extends ServletAction {
	/*************************************************************************
	 * 初始化方法
	 */
	public void init() throws ServletException {
		try {
			File isf = new File(LoaConst.getFileInfoParam("indexStorePath"));
			FileUtils.deleteFiles(isf);
			isf.mkdirs();
			LuceneUtils.buildIndex(new File(
					LoaConst.getFileInfoParam("rootUploadPath") + "doc/"), isf);
		} catch (Exception e) {
			 e.printStackTrace();
		}
	}

	/*************************************************************************
	 * 请求
	 */
	public void service(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {
		String flag = req.getParameter("flag");
	}
	

}
